package com.mikeli.javacourse.lesson5;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
import org.springframework.context.annotation.PropertySource;

import javax.annotation.Resource;

@Configuration
@PropertySource("classpath:application.properties")
public class BeanConfig {

    @Bean("klass1")
    public Klass genKlass(){
        Klass klass = new Klass();
        klass.setKlassName("我是Configuration注解生成的");
        klass.setStudent(new Student());
        return klass;
    }
}
